package test1014;

import java.util.Scanner;

public class EnrollmentSystem {
    private String name;
    private String hometown;
    private int age;
    private String enrollmentDate;
    private String className;
    private String notificationNumber;

    public void register() {
        Scanner scanner = new Scanner(System.in);

        System.out.print("请输入姓名: ");
        name = scanner.nextLine();

        System.out.print("请输入祖籍: ");
        hometown = scanner.nextLine();

        System.out.print("请输入年龄: ");
        age = scanner.nextInt();
        scanner.nextLine(); // 消耗掉输入缓冲区中的换行符

        System.out.print("请输入入学日期: ");
        enrollmentDate = scanner.nextLine();

        System.out.print("请输入班级: ");
        className = scanner.nextLine();

        System.out.print("请输入通知书编号: ");
        notificationNumber = scanner.nextLine();
    }

    public void displayRegistrationInfo() {
        System.out.println("姓名: " + name);
        System.out.println("祖籍: " + hometown);
        System.out.println("年龄: " + age);
        System.out.println("入学日期: " + enrollmentDate);
        System.out.println("班级: " + className);
        System.out.println("通知书编号: " + notificationNumber);
    }

    public static void main(String[] args) {
        EnrollmentSystem enrollmentSystem = new EnrollmentSystem();
        enrollmentSystem.register();
        System.out.println("\n入学人员登记信息:");
        enrollmentSystem.displayRegistrationInfo();
    }
}